<template>
  <div id="q-app">
    <q-ajax-bar />
    <router-view />
  </div>
</template>
<script>

export default {
  name: 'App',
  data() {
    return {
    };
  },
  methods: {
  },
  created() {
    this.$store.commit('Rule/updateMobile', this.$q.platform.is.mobile);
  },
  watch: {
    $route(to) {
      // 登录页面不应该添加到路由导航里面,如果是研发平台的功能，那么这里就不做控制
      if ((!(to.path.indexOf('/login') === 0) && !this.$store.state.Rule.routeTabs.some((r) => r.path === to.path)) || to.path === '/dyn/view' || to.path === '/dyn/h5/view' || to.path === '/bi/screen/design/viewpage') {
        if (to.meta.title) {
          this.$store.commit('Rule/addRouteTabs', { name: to.meta.title, path: to.path, fullPath: to.fullPath });
        }
      }
    },
  },
};
</script>
